You are here: Statements and Functions > ObjectID()
Syntax samples
ObjectID()
Returns the unique ID number associated with the entity calling the function. As each entity enters the simulation, whether through an arrival, order, or being created, its ID number is incremented in sequence, thus ensuring that every ObjectID is unique throughout the simulation. The first entity is given the number 1, and each subsequent entity’s ID number is incremented by 1.
Any logic.
Example
Every 100th entity entering a process step must be routed to a QA process. By dividing the ObjectID number by 100, you can route every entity that has no remainder (ID number divides evenly by 100) to the QA process.
Process Table
Entity |
Location |
Operation (min) |
---|---|---|
EntA |
Pre_QA |
Real Test Test=ObjectID() Mod 100 If Test<>0 Then Route 1 Else Route 2 |
Routing Table
Blk |
Output |
Destination |
Rule |
Move Logic |
---|---|---|---|---|
1 |
EntA |
Packaging |
FIRST 1 |
|
2 |
EntA |
QA |
FIRST 1 |
|